package com.etc.web;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

@RestController
public class TestTokenLoginController {
//
    @RequestMapping(value = "login.action", produces = "application/json;charset=UTF-8")
    public String login(String username, String password) {
        System.out.println(username + "@" + password);
        return "{\n" +
                "        \"code\": 20000,\n" +
                "        \"data\": \"admin-token\"" +
                "      }";
    }
    @RequestMapping(value = "info.action", produces = "application/json;charset=UTF-8")
    public String info(HttpServletResponse rep) {

        return "   {\n" +
                "        \"code\": 20000,\n" +
                "        \"data\":  {\"roles\": [\"admin\"],\n" +
                "    \"introduction\": \"I am a super administrator\",\n" +
                "    \"avatar\": \"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif\",\n" +
                "    \"name\": \"Super Admin\"}\n" +
                "    }";
    }


}
